1. Field of the Invention
The present invention relates to an information processing apparatus, an information processing method, and a non-transitory computer-readable storage medium and, more particularly, to an information processing apparatus, information processing method, and computer-readable non-transitory storage medium which are applied to an apparatus or method for detecting a specific subject such as a person from an image.
2. Description of the Related Art
As a technique of detecting an object from an image captured by a camera, a method of detecting a moving object using a background-difference method is known. In the background-difference method, a fixed camera captures a background image with no subject and its feature amount is stored as a background model. Then, the feature amount of an image input by the camera is compared with the feature amount of the background model, and a region of the input image, which has a feature amount different from that of the background model, is detected as the foreground (an object).
The background may change with time. For example, the brightness of the background changes according to a change in illumination. In this case, there is a difference between the background of an image captured by the camera and a background image previously captured and stored, thereby disabling normal detection. In Japanese Patent Laid-Open No. 2002-099909, to reduce the influence of a change in background, a background model is updated at given intervals. Furthermore, Japanese Patent Laid-Open No. 2002-099909 discloses a method of excluding from background-update target regions, when an intrusion object is detected, a region in which the intrusion object has been detected in order to prevent the intrusion object from being considered as the background in an update process. Japanese Patent No. 2913882 discloses a method of updating a background image based on an input image using an exponential smoothing method.
Assume that a static object, such as a bag or vase, newly appears. Such an object may be continuously detected for a while, since a person may have left it behind or abandoned it. On the other hand, an object which has remained for a long time may be considered as part of the background. In Japanese Patent Laid-Open No. 2002-099909, however, since the background is not updated with respect to a region where an intrusion object has been detected, the region is continuously detected as the foreground all the time. If it is desirable to deal with the remaining object as the background later, it is necessary to initialize the background model. In Japanese Patent No. 2913882, any type of object that has newly appeared is dealt with as the background after a predetermined period of time elapses. Therefore, the user cannot change, depending on the situation or the type of object to be detected, a time during which the object is continuously detected.
U.S. Publication No. 2009/0290020 discloses a method of detecting an object using, as a condition for determining the foreground and background in a captured image, time information indicating how long an image feature amount exists in a video, as well as a difference between image feature amounts. In U.S. Publication No. 2009/0290020, therefore, not only the feature amount of the background, but also the feature amount of a detected object is held as the status of a background model. Every time the feature amount of the object appears in a video, time information corresponding to the feature amount is updated. If, for example, a red bag is placed, a status indicating a red feature amount is added as the status of the background. If, then, the red bag remains there, the status indicating the red feature amount always exists at the same position in the video, and therefore, the time information is updated every time its existence is identified. This enables the detection of the red bag as an object not considered part of the background before a predetermined period of time elapses, and treats the red bag as part of the background after the predetermined period of time elapses.
In a certain place, such as a waiting room, however, a person often stops at one place for a certain period of time, and then starts moving. Even though time information is added as an object-determination condition, as in U.S. Publication No. 2009/0290020, a person is unwantedly considered as the background if he/she continues to stop longer than the predetermined period of time. Consequently, it becomes impossible to detect the person even if a person is always a detection target. Similarly, in Japanese Patent No. 2913882, a person who continues to stop is considered as the background, thereby disabling the detection of the person. On the other hand, according to Japanese Patent Laid-Open No. 2002-099909, a person is always detected, but an object left behind that should be dealt with as the background is unwantedly continuously detected for an indefinite time, as described above. As a result, in the conventional techniques, it is impossible to temporarily detect a static object (an object left behind or an abandoned object) while constantly detecting a specific subject, such as a person.
The present invention has been made in consideration of the above problems. The present invention provides a technique of detecting, as the foreground, a region that is probably considered as a subject in an image.